package Main.tcp;

import java.net.Socket;

/**
 * PACKAGE_NAME: Main.tcp
 * Description:
 * 测试Socket 还没连接Server时候  是否占用了本地端口
 */
public class TCPTest3 {
    public static void main(String[] args) {
        Socket socket = new Socket();
        System.out.println("本地端口：" + socket.getLocalPort()); // -1
        System.out.println(socket.getPort()); // 0
        System.out.println(socket.getInetAddress()); // null
    }
}
